package com.meietling.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author LING
 * MVC处理器
 * 代替spring中的Servlet实现类，由DispatcherServlet（即中央调度器）统一调度
 */
@Controller
@RequestMapping(value = "/one")
public class OneController {

    @RequestMapping(value = "/test1.do",method = RequestMethod.GET)
    public ModelAndView test1(){
        ModelAndView view = new ModelAndView();
        view.addObject("id",1);
        view.addObject("name","xiaoA");
        view.addObject("score",85);
        view.setViewName("/test2.jsp");
        return view;
    }

    /**
     *
     * String
     */
    @RequestMapping(value = "/test2.do")
    public String test2(){
        System.out.println();
        return "/test3.jsp";
    }

    /**
     *
     * void
     */
    @RequestMapping(value = "/test3.do")
    public void test3(){


    }
}
